package com.example.mansystem.dto;


import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

@Data
@NoArgsConstructor
public class UserInfoDto {
    @Positive(message = "Id必须是正数")
    private int id;
    @Pattern(regexp = "^[\u4e00-\u9fa5]{2,6}$",message = "姓名格式不正确")
    @NotBlank(message = "姓名不为空")
    private String name;
    @Positive(message = "roleId必须是正数")
    private int roleid;
    @NotBlank(message = "性别不为空")
    private String sex;
    @Length(min = 3,max=18)
    @Pattern(regexp = "^[a-z0-9A-Z_-]{3,16}$",message = "用户名格式不正确")
    private String username;
    private String departmentId;
}
